package com.liyao.storehouse.controller;

import com.liyao.storehouse.service.userService;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

/**
 * @program: storehouse
 * @description: user
 * @author: liu yan
 * @create: 2024-11-18 14:34
 */
@Controller
@RequestMapping("/user")
public class userController {

    @Resource
    userService service;
    @RequestMapping("/User")
    @ResponseBody
    public JSONObject getUser(int page, int limit, HttpSession session){
        return service.getUser(page,limit,session);
    }

    @RequestMapping("role")
    @ResponseBody
    public JSONObject getRole(int page,int limit){
        return service.getRole(page,limit);
    }

    @RequestMapping("/getMenuList")
    @ResponseBody
    public JSONArray getMenuList(){
        return service.getMenuList();
    }

    //修改角色
    @RequestMapping("/editRole")
    @ResponseBody
    public JSONObject editRole(String roleName,String roleCont,String id){
        return service.editRole(roleName,roleCont,id);
    }

}
